Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SBA School Management System #13

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

AnjaliG927
Copy link

@AnjaliG927 AnjaliG927 commented Sep 7, 2020

Completed

Copy link
Contributor

@Git-Leon Git-Leon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

private String password;

@OneToMany()
@JoinTable(name = "student-course", joinColumns = {@JoinColumn(name = "email")},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 🔥

return null;
}

@Override
public Boolean validateStudent(String studentEmail, String password) {
return null;
Boolean isValid= getAllStudents().stream()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider
password.equals(Objects.requireNonNull(getStudentByEmail(studentEmail)).getPassword());

.filter(courseInterface -> courseInterface.getId().equals(courseId))
.findFirst().get();

student.getCourses().add(addCourse);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this appears to be adding the course to the ArrayList returned by getCourses().
Can you verify that this is persisting the course registry of the Student?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Leon. Yes, it was not persisting in the database. I changed the code.


// when
// TODO - define `when` clause

String expected= service.getStudentByEmail(email).getEmail();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// when
Student actual = service.getStudentByEmail(email);

public void test() {
JdbcConfigurator.initialize();
StudentDao service = (StudentDao) new StudentService();
String email="[email protected]";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// given
String expectedEmail = "[email protected]";
String expectedName = ...;
Long expectedId = ...;
Student expectedStudent = new Student(expectedId, expectedEmail, expectedName);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants